<%
disabled_workflow = []
selected_workflow = nil
unless User.current.allowed_to?(:file_approval, @project)
	disabled_workflow << 2
	current_workflow = upload.workflow
	if current_workflow == 1 || current_workflow == 2
		disabled_workflow << nil
		selected_workflow = 1
	end
else
	selected_workflow = upload.workflow
end
%>
<div class="box dmsf_detail">
	<%= hidden_field_tag("commited_files[#{i}][disk_filename]", upload.disk_filename) %>
	<div class="clear">
		<div class="splitcontentleft">
			<p>
				<%= label_tag("commited_files[#{i}][title]", l(:label_title) + ":") %>
				<%= text_field_tag("commited_files[#{i}][title]", upload.title, :size => "32") %>
			</p>
		</div>
		<div class="splitcontentright">
			<p>
				<%= label_tag("", l(:label_filename) + ":") %>
				<%= h(upload.name) %>
				<%= hidden_field_tag("commited_files[#{i}][name]", upload.name) %>
			</p>
		</div>
	</div>
	<p class="no-ident">
		<%= label_tag("commited_files[#{i}][description]", l(:label_description) + ":") %>
	</p>
	<div class="wiki data clear">
		<%= text_area_tag("commited_files[#{i}][description]", upload.description, :rows=> "6", :class => "wiki-edit") %>
	</div>
	<div class="splitcontentleft">
		<p>
			<%= label_tag("commited_files[#{i}][version]_minor", l(:label_version) + ":") %>
		</p>
		<div class="data clear">
			<%= radio_button_tag("commited_files[#{i}][version]", "minor", true) %> 
			<%= upload.major_version %>.<%= upload.minor_version + 1 %> <%= l(:option_version_minor) %><br />
			<%= radio_button_tag("commited_files[#{i}][version]", "major") %> 
			<%= upload.major_version + 1 %>.0 <%= l(:option_version_major) %><br />
		</div>
		<p>
			<%= label_tag("commited_files[#{i}][workflow]", l(:label_workflow) + ":") %>
			<%= select_tag("commited_files[#{i}][workflow]", 
					options_for_select([
							[l(:option_workflow_none), nil], 
							[l(:option_workflow_waiting_for_approval), 1],
							[l(:option_workflow_approved), 2]], 
						:selected => selected_workflow, :disabled => disabled_workflow)) %>
		</p>
	</div>
	<div class="splitcontentright clear">
		<p>
			<%= label_tag("", l(:label_mime) + ":") %>
			<%= h(upload.mime_type) %>
		</p>
		<p>
			<%= label_tag("", l(:label_size) + ":") %>
			<%= number_to_human_size(upload.size) %>
		</p>
	</div>
	<br style="clear: both"/>
	<p>
		<%= label_tag("commited_files[#{i}][comment]", l(:label_comment) + ":") %>
		<div class="data">
			<%= text_area_tag("commited_files[#{i}][comment]", upload.comment, :rows=> "2", :style => "width: 99%;") %>
		</div>
	</p>
</div>

<%= wikitoolbar_for "commited_files_#{i}_description" %>
